#include "sgt_style.hpp"

SgtStyle::SgtStyle()
{
    load_style(":/qss/global.css",GLOBAL);
}

void SgtStyle::load_style(const QString path,int sort)
{
    QString qss_style;
    if(qt::file::read_all(path,qss_style)){
        style_map[sort] = qss_style;
    }
}

SgtStyle::~SgtStyle()
{
    style_map.clear();
}

bool SgtStyle::get_style(QString& str,int sort)
{
    if(style_map.find(sort)==style_map.end()){
        return false;
    }
    str = style_map[sort];
    return true;
}